<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta charset="utf-8" />
    <title>geosnap._data &#8212; geosnap v0.3.1 Manual</title>
    <link rel="stylesheet" href="../../_static/bootstrap-sphinx.css" type="text/css" />
    <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
    <link rel="stylesheet" type="text/css" href="../../_static/pysal-styles.css" />
    <script id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
    <script src="../../_static/jquery.js"></script>
    <script src="../../_static/underscore.js"></script>
    <script src="../../_static/doctools.js"></script>
    <script src="../../_static/language_data.js"></script>
    <link rel="shortcut icon" href="../../_static/geosnap.ico"/>
    <link rel="index" title="Index" href="../../genindex.html" />
    <link rel="search" title="Search" href="../../search.html" />
<meta charset='utf-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1'>
<meta name="apple-mobile-web-app-capable" content="yes">
<script type="text/javascript" src="../../_static/js/jquery-1.11.0.min.js "></script>
<script type="text/javascript" src="../../_static/js/jquery-fix.js "></script>
<script type="text/javascript" src="../../_static/bootstrap-3.3.7/js/bootstrap.min.js "></script>
<script type="text/javascript" src="../../_static/bootstrap-sphinx.js "></script>

  </head><body>

  <div id="navbar" class="navbar navbar-default navbar-fixed-top">
    <div class="container">
      <div class="navbar-header">
        <!-- .btn-navbar is used as the toggle for collapsed navbar content -->
        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".nav-collapse">
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
        </button>
        <a class="navbar-brand" href="../../index.html"><span><img src="../../_static/geosnap.svg"></span>
          geosnap</a>
        <span class="navbar-text navbar-version pull-left"><b>0.3.1</b></span>
      </div>

        <div class="collapse navbar-collapse nav-collapse">
          <ul class="nav navbar-nav">
            
                <li><a href="../../installation.html">Installation</a></li>
                <li><a href="../../api.html">API</a></li>
                <li><a href="../../data.html">Data</a></li>
                <li><a href="https://spatialucr.github.io/geosnap-guide/">User Guide</a></li>
                <li><a href="../../references.html">References</a></li>
            
            
              <li class="dropdown globaltoc-container">
  <a role="button"
     id="dLabelGlobalToc"
     data-toggle="dropdown"
     data-target="#"
     href="../../index.html">Site <b class="caret"></b></a>
  <ul class="dropdown-menu globaltoc"
      role="menu"
      aria-labelledby="dLabelGlobalToc"><p class="caption"><span class="caption-text">Contents:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../installation.html">Installation</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../../installation.html#installing-a-released-version">Installing a released version</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../installation.html#installing-development-version">Installing development version</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../api.html">API</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../../api.html#io-module">IO Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../api.html#the-community-class">The Community Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../api.html#analyze-module">Analyze Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../api.html#harmonize-module">Harmonize Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../api.html#visualize-module">Visualize Module</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../references.html">References</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../data.html">Data</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../../data.html#tabular-data">Tabular Data</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../data.html#geo-data">Geo Data</a></li>
</ul>
</li>
</ul>
</ul>
</li>
              
                <li class="dropdown">
  <a role="button"
     id="dLabelLocalToc"
     data-toggle="dropdown"
     data-target="#"
     href="#">Page <b class="caret"></b></a>
  <ul class="dropdown-menu localtoc"
      role="menu"
      aria-labelledby="dLabelLocalToc"></ul>
</li>
              
            
            
            
            
            
          </ul>

          
            
<form class="navbar-form navbar-right" action="../../search.html" method="get">
 <div class="form-group">
  <input type="text" name="q" class="form-control" placeholder="Search" />
 </div>
  <input type="hidden" name="check_keywords" value="yes" />
  <input type="hidden" name="area" value="default" />
</form>
          
        </div>
    </div>
  </div>

<div class="container">
  <div class="row">
    <div class="body col-md-12 content" role="main">
      
  <h1>Source code for geosnap._data</h1><div class="highlight"><pre>
<span></span><span class="sd">&quot;&quot;&quot;Tools for creating and manipulating neighborhood datasets.&quot;&quot;&quot;</span>

<span class="kn">import</span> <span class="nn">multiprocessing</span>
<span class="kn">import</span> <span class="nn">os</span>
<span class="kn">import</span> <span class="nn">pathlib</span>
<span class="kn">from</span> <span class="nn">warnings</span> <span class="kn">import</span> <span class="n">warn</span>

<span class="kn">import</span> <span class="nn">geopandas</span> <span class="k">as</span> <span class="nn">gpd</span>
<span class="kn">import</span> <span class="nn">pandas</span> <span class="k">as</span> <span class="nn">pd</span>
<span class="kn">import</span> <span class="nn">quilt3</span>
<span class="kn">from</span> <span class="nn">appdirs</span> <span class="kn">import</span> <span class="n">user_data_dir</span>
<span class="kn">from</span> <span class="nn">requests.exceptions</span> <span class="kn">import</span> <span class="n">Timeout</span>
<span class="kn">from</span> <span class="nn">shapely</span> <span class="kn">import</span> <span class="n">wkb</span><span class="p">,</span> <span class="n">wkt</span>

<span class="n">appname</span> <span class="o">=</span> <span class="s2">&quot;geosnap&quot;</span>
<span class="n">appauthor</span> <span class="o">=</span> <span class="s2">&quot;geosnap&quot;</span>
<span class="n">data_dir</span> <span class="o">=</span> <span class="n">user_data_dir</span><span class="p">(</span><span class="n">appname</span><span class="p">,</span> <span class="n">appauthor</span><span class="p">)</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">data_dir</span><span class="p">):</span>
    <span class="n">pathlib</span><span class="o">.</span><span class="n">Path</span><span class="p">(</span><span class="n">data_dir</span><span class="p">)</span><span class="o">.</span><span class="n">mkdir</span><span class="p">(</span><span class="n">parents</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">exist_ok</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>

<span class="c1"># look for local storage and create if missing</span>
<span class="k">try</span><span class="p">:</span>
    <span class="n">storage</span> <span class="o">=</span> <span class="n">quilt3</span><span class="o">.</span><span class="n">Package</span><span class="o">.</span><span class="n">browse</span><span class="p">(</span><span class="s2">&quot;geosnap_data/storage&quot;</span><span class="p">)</span>
<span class="k">except</span> <span class="ne">FileNotFoundError</span><span class="p">:</span>
    <span class="n">storage</span> <span class="o">=</span> <span class="n">quilt3</span><span class="o">.</span><span class="n">Package</span><span class="p">()</span>


<span class="k">class</span> <span class="nc">_Map</span><span class="p">(</span><span class="nb">dict</span><span class="p">):</span>
    <span class="sd">&quot;&quot;&quot;tabbable dict.&quot;&quot;&quot;</span>

    <span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
        <span class="nb">super</span><span class="p">(</span><span class="n">_Map</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
        <span class="k">for</span> <span class="n">arg</span> <span class="ow">in</span> <span class="n">args</span><span class="p">:</span>
            <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">arg</span><span class="p">,</span> <span class="nb">dict</span><span class="p">):</span>
                <span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">arg</span><span class="o">.</span><span class="n">iteritems</span><span class="p">():</span>
                    <span class="bp">self</span><span class="p">[</span><span class="n">k</span><span class="p">]</span> <span class="o">=</span> <span class="n">v</span>

        <span class="k">if</span> <span class="n">kwargs</span><span class="p">:</span>
            <span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">kwargs</span><span class="o">.</span><span class="n">iteritems</span><span class="p">():</span>
                <span class="bp">self</span><span class="p">[</span><span class="n">k</span><span class="p">]</span> <span class="o">=</span> <span class="n">v</span>

    <span class="k">def</span> <span class="fm">__getattr__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">attr</span><span class="p">):</span>
        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">attr</span><span class="p">)</span>

    <span class="k">def</span> <span class="fm">__setattr__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">key</span><span class="p">,</span> <span class="n">value</span><span class="p">):</span>
        <span class="bp">self</span><span class="o">.</span><span class="fm">__setitem__</span><span class="p">(</span><span class="n">key</span><span class="p">,</span> <span class="n">value</span><span class="p">)</span>

    <span class="k">def</span> <span class="fm">__setitem__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">key</span><span class="p">,</span> <span class="n">value</span><span class="p">):</span>
        <span class="nb">super</span><span class="p">(</span><span class="n">_Map</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="fm">__setitem__</span><span class="p">(</span><span class="n">key</span><span class="p">,</span> <span class="n">value</span><span class="p">)</span>
        <span class="bp">self</span><span class="o">.</span><span class="vm">__dict__</span><span class="o">.</span><span class="n">update</span><span class="p">({</span><span class="n">key</span><span class="p">:</span> <span class="n">value</span><span class="p">})</span>

    <span class="k">def</span> <span class="fm">__delattr__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">item</span><span class="p">):</span>
        <span class="bp">self</span><span class="o">.</span><span class="fm">__delitem__</span><span class="p">(</span><span class="n">item</span><span class="p">)</span>

    <span class="k">def</span> <span class="fm">__delitem__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">key</span><span class="p">):</span>
        <span class="nb">super</span><span class="p">(</span><span class="n">_Map</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="fm">__delitem__</span><span class="p">(</span><span class="n">key</span><span class="p">)</span>
        <span class="k">del</span> <span class="bp">self</span><span class="o">.</span><span class="vm">__dict__</span><span class="p">[</span><span class="n">key</span><span class="p">]</span>


<span class="k">def</span> <span class="nf">_deserialize_wkb</span><span class="p">(</span><span class="nb">str</span><span class="p">):</span>
    <span class="k">return</span> <span class="n">wkb</span><span class="o">.</span><span class="n">loads</span><span class="p">(</span><span class="nb">str</span><span class="p">,</span> <span class="nb">hex</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>


<span class="k">def</span> <span class="nf">_deserialize_wkt</span><span class="p">(</span><span class="nb">str</span><span class="p">):</span>
    <span class="k">return</span> <span class="n">wkt</span><span class="o">.</span><span class="n">loads</span><span class="p">(</span><span class="nb">str</span><span class="p">)</span>


<span class="k">def</span> <span class="nf">_convert_gdf</span><span class="p">(</span><span class="n">df</span><span class="p">):</span>
    <span class="sd">&quot;&quot;&quot;Convert DataFrame to GeoDataFrame.</span>

<span class="sd">    DataFrame to GeoDataFrame by converting wkt/wkb geometry representation</span>
<span class="sd">    back to Shapely object.</span>

<span class="sd">    Parameters</span>
<span class="sd">    ----------</span>
<span class="sd">    df : pandas.DataFrame</span>
<span class="sd">        dataframe with column named either &quot;wkt&quot; or &quot;wkb&quot; that stores</span>
<span class="sd">        geometric information as well-known text or well-known binary,</span>
<span class="sd">        (hex encoded) respectively.</span>

<span class="sd">    Returns</span>
<span class="sd">    -------</span>
<span class="sd">    geopandas.GeoDataFrame</span>
<span class="sd">        geodataframe with converted `geometry` column.</span>

<span class="sd">    &quot;&quot;&quot;</span>
    <span class="n">df</span> <span class="o">=</span> <span class="n">df</span><span class="o">.</span><span class="n">copy</span><span class="p">()</span>
    <span class="n">df</span><span class="o">.</span><span class="n">reset_index</span><span class="p">(</span><span class="n">inplace</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">drop</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>

    <span class="k">if</span> <span class="s2">&quot;wkt&quot;</span> <span class="ow">in</span> <span class="n">df</span><span class="o">.</span><span class="n">columns</span><span class="o">.</span><span class="n">tolist</span><span class="p">():</span>
        <span class="k">with</span> <span class="n">multiprocessing</span><span class="o">.</span><span class="n">Pool</span><span class="p">()</span> <span class="k">as</span> <span class="n">P</span><span class="p">:</span>
            <span class="n">df</span><span class="p">[</span><span class="s2">&quot;geometry&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">P</span><span class="o">.</span><span class="n">map</span><span class="p">(</span><span class="n">_deserialize_wkt</span><span class="p">,</span> <span class="n">df</span><span class="p">[</span><span class="s2">&quot;wkt&quot;</span><span class="p">])</span>
        <span class="n">df</span> <span class="o">=</span> <span class="n">df</span><span class="o">.</span><span class="n">drop</span><span class="p">(</span><span class="n">columns</span><span class="o">=</span><span class="p">[</span><span class="s2">&quot;wkt&quot;</span><span class="p">])</span>

    <span class="k">else</span><span class="p">:</span>
        <span class="k">with</span> <span class="n">multiprocessing</span><span class="o">.</span><span class="n">Pool</span><span class="p">()</span> <span class="k">as</span> <span class="n">P</span><span class="p">:</span>
            <span class="n">df</span><span class="p">[</span><span class="s2">&quot;geometry&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">P</span><span class="o">.</span><span class="n">map</span><span class="p">(</span><span class="n">_deserialize_wkb</span><span class="p">,</span> <span class="n">df</span><span class="p">[</span><span class="s2">&quot;wkb&quot;</span><span class="p">])</span>
        <span class="n">df</span> <span class="o">=</span> <span class="n">df</span><span class="o">.</span><span class="n">drop</span><span class="p">(</span><span class="n">columns</span><span class="o">=</span><span class="p">[</span><span class="s2">&quot;wkb&quot;</span><span class="p">])</span>

    <span class="n">df</span> <span class="o">=</span> <span class="n">gpd</span><span class="o">.</span><span class="n">GeoDataFrame</span><span class="p">(</span><span class="n">df</span><span class="p">)</span>
    <span class="n">df</span><span class="o">.</span><span class="n">crs</span> <span class="o">=</span> <span class="p">{</span><span class="s2">&quot;init&quot;</span><span class="p">:</span> <span class="s2">&quot;epsg:4326&quot;</span><span class="p">}</span>

    <span class="k">return</span> <span class="n">df</span>


<span class="k">class</span> <span class="nc">DataStore</span><span class="p">:</span>
    <span class="sd">&quot;&quot;&quot;Storage for geosnap data. Currently supports US Census data.</span>

<span class="sd">        Unless otherwise noted, data are collected from the U.S. Census Bureau&#39;s TIGER/LINE Files</span>
<span class="sd">        https://www.census.gov/cgi-bin/geo/shapefiles/index.php?year=2018 and converted to</span>
<span class="sd">        parquet files.</span>

<span class="sd">    &quot;&quot;&quot;</span>

    <span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;Instantiate a new DataStore object.&quot;&quot;&quot;</span>

        <span class="k">try</span><span class="p">:</span> <span class="c1"># if any of these aren&#39;t found, stream them insteead</span>
            <span class="n">administrative</span> <span class="o">=</span> <span class="n">quilt3</span><span class="o">.</span><span class="n">Package</span><span class="o">.</span><span class="n">browse</span><span class="p">(</span><span class="s2">&quot;census/administrative&quot;</span><span class="p">)</span>
            <span class="n">tracts_cartographic</span> <span class="o">=</span> <span class="n">quilt3</span><span class="o">.</span><span class="n">Package</span><span class="o">.</span><span class="n">browse</span><span class="p">(</span><span class="s2">&quot;census/tracts_cartographic&quot;</span><span class="p">)</span>
        <span class="k">except</span> <span class="ne">FileNotFoundError</span><span class="p">:</span>
            <span class="n">warn</span><span class="p">(</span>
                <span class="s2">&quot;Unable to locate local census data. Streaming instead.</span><span class="se">\n</span><span class="s2">&quot;</span>
                <span class="s2">&quot;If you plan to use census data repeatedly you can store it locally &quot;</span>
                <span class="s2">&quot;with the io.store_census function for better performance&quot;</span>
            <span class="p">)</span>
            <span class="k">try</span><span class="p">:</span>
                <span class="n">tracts_cartographic</span> <span class="o">=</span> <span class="n">quilt3</span><span class="o">.</span><span class="n">Package</span><span class="o">.</span><span class="n">browse</span><span class="p">(</span>
                    <span class="s2">&quot;census/tracts_cartographic&quot;</span><span class="p">,</span> <span class="s2">&quot;s3://spatial-ucr&quot;</span>
                <span class="p">)</span>
                <span class="n">administrative</span> <span class="o">=</span> <span class="n">quilt3</span><span class="o">.</span><span class="n">Package</span><span class="o">.</span><span class="n">browse</span><span class="p">(</span>
                    <span class="s2">&quot;census/administrative&quot;</span><span class="p">,</span> <span class="s2">&quot;s3://spatial-ucr&quot;</span>
                <span class="p">)</span>

            <span class="k">except</span> <span class="n">Timeout</span><span class="p">:</span>
                <span class="n">warn</span><span class="p">(</span>
                    <span class="s2">&quot;Unable to locate local census data and unable to reach s3 bucket.&quot;</span>
                    <span class="s2">&quot;You will be unable to use built-in data during this session. &quot;</span>
                    <span class="s2">&quot;If you need these data, please try downloading a local copy &quot;</span>
                    <span class="s2">&quot;with the io.store_census function, then restart your &quot;</span>
                    <span class="s2">&quot;python kernel and try again.&quot;</span>
                <span class="p">)</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">tracts_cartographic</span> <span class="o">=</span> <span class="n">tracts_cartographic</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">administrative</span> <span class="o">=</span> <span class="n">administrative</span>

    <span class="k">def</span> <span class="fm">__dir__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>

        <span class="n">atts</span> <span class="o">=</span> <span class="p">[</span>
            <span class="s2">&quot;blocks_2000&quot;</span><span class="p">,</span>
            <span class="s2">&quot;blocks_2010&quot;</span><span class="p">,</span>
            <span class="s2">&quot;codebook&quot;</span><span class="p">,</span>
            <span class="s2">&quot;counties&quot;</span><span class="p">,</span>
            <span class="s2">&quot;ltdb&quot;</span><span class="p">,</span>
            <span class="s2">&quot;msa_definitions&quot;</span><span class="p">,</span>
            <span class="s2">&quot;msas&quot;</span><span class="p">,</span>
            <span class="s2">&quot;ncdb&quot;</span><span class="p">,</span>
            <span class="s2">&quot;states&quot;</span><span class="p">,</span>
            <span class="s2">&quot;tracts_1990&quot;</span><span class="p">,</span>
            <span class="s2">&quot;tracts_2000&quot;</span><span class="p">,</span>
            <span class="s2">&quot;tracts_2010&quot;</span><span class="p">,</span>
        <span class="p">]</span>

        <span class="k">return</span> <span class="n">atts</span>

    <span class="k">def</span> <span class="nf">blocks_2000</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">states</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">convert</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">fips</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;Census blocks for 2000.</span>

<span class="sd">        Parameters</span>
<span class="sd">        ----------</span>
<span class="sd">        states : list-like</span>
<span class="sd">            list of state fips codes to return as a datafrrame.</span>
<span class="sd">        convert : bool</span>
<span class="sd">        if True, return geodataframe, else return dataframe (the default is True).</span>

<span class="sd">        Returns</span>
<span class="sd">        -------</span>
<span class="sd">        type</span>
<span class="sd">        pandas.DataFrame or geopandas.GeoDataFrame</span>
<span class="sd">            2000 blocks as a geodataframe or as a dataframe with geometry</span>
<span class="sd">            stored as well-known binary on the &#39;wkb&#39; column.</span>

<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">try</span><span class="p">:</span>
            <span class="n">blocks_2000</span> <span class="o">=</span> <span class="n">quilt3</span><span class="o">.</span><span class="n">Package</span><span class="o">.</span><span class="n">browse</span><span class="p">(</span><span class="s2">&quot;census/blocks_2000&quot;</span><span class="p">)</span> <span class="c1"># if any of these aren&#39;t found, stream them instead</span>
        <span class="k">except</span> <span class="ne">FileNotFoundError</span><span class="p">:</span>
            <span class="n">warn</span><span class="p">(</span>
                <span class="s2">&quot;Unable to locate local census 2000 block data. Streaming instead.</span><span class="se">\n</span><span class="s2">&quot;</span>
                <span class="s2">&quot;If you plan to use census data repeatedly you can store it locally &quot;</span>
                <span class="s2">&quot;with the io.store_blocks_2000 function for better performance&quot;</span>
            <span class="p">)</span>
            <span class="k">try</span><span class="p">:</span>
                <span class="n">blocks_2000</span> <span class="o">=</span> <span class="n">quilt3</span><span class="o">.</span><span class="n">Package</span><span class="o">.</span><span class="n">browse</span><span class="p">(</span>
                    <span class="s2">&quot;census/blocks_2000&quot;</span><span class="p">,</span> <span class="s2">&quot;s3://spatial-ucr&quot;</span>
                <span class="p">)</span>

            <span class="k">except</span> <span class="n">Timeout</span><span class="p">:</span>
                <span class="n">warn</span><span class="p">(</span>
                    <span class="s2">&quot;Unable to locate local census data and unable to reach s3 bucket.&quot;</span>
                    <span class="s2">&quot;You will be unable to use built-in data during this session. &quot;</span>
                    <span class="s2">&quot;Try downloading a local copy with the io.store_blocks_2000 function,&quot;</span>
                    <span class="s2">&quot;then restart your python kernel and try again.&quot;</span>
                <span class="p">)</span>

        <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">states</span><span class="p">,</span> <span class="p">(</span><span class="nb">str</span><span class="p">,)):</span>
            <span class="n">states</span> <span class="o">=</span> <span class="p">[</span><span class="n">states</span><span class="p">]</span>
        <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">states</span><span class="p">,</span> <span class="p">(</span><span class="nb">int</span><span class="p">,)):</span>
            <span class="n">states</span> <span class="o">=</span> <span class="p">[</span><span class="n">states</span><span class="p">]</span>
        <span class="n">blks</span> <span class="o">=</span> <span class="p">{}</span>
        <span class="k">for</span> <span class="n">state</span> <span class="ow">in</span> <span class="n">states</span><span class="p">:</span>
            <span class="n">blks</span><span class="p">[</span><span class="n">state</span><span class="p">]</span> <span class="o">=</span> <span class="n">blocks_2000</span><span class="p">[</span><span class="sa">f</span><span class="s2">&quot;</span><span class="si">{state}</span><span class="s2">.parquet&quot;</span><span class="p">]()</span>
            <span class="k">if</span> <span class="n">fips</span><span class="p">:</span>
                <span class="n">blks</span><span class="p">[</span><span class="n">state</span><span class="p">]</span> <span class="o">=</span> <span class="n">blks</span><span class="p">[</span><span class="n">state</span><span class="p">][</span><span class="n">blks</span><span class="p">[</span><span class="n">state</span><span class="p">][</span><span class="s2">&quot;geoid&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">str</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="n">fips</span><span class="p">)]</span>
            <span class="n">blks</span><span class="p">[</span><span class="n">state</span><span class="p">][</span><span class="s2">&quot;year&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="mi">2000</span>
        <span class="n">blocks</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="n">blks</span><span class="o">.</span><span class="n">values</span><span class="p">())</span>
        <span class="n">blocks</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">concat</span><span class="p">(</span><span class="n">blocks</span><span class="p">,</span> <span class="n">sort</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
        <span class="k">if</span> <span class="n">convert</span><span class="p">:</span>
            <span class="k">return</span> <span class="n">_convert_gdf</span><span class="p">(</span><span class="n">blocks</span><span class="p">)</span>
        <span class="k">return</span> <span class="n">blocks</span>

    <span class="k">def</span> <span class="nf">blocks_2010</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">states</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">convert</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">fips</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;Census blocks for 2010.</span>

<span class="sd">        Parameters</span>
<span class="sd">        ----------</span>
<span class="sd">        states : list-like</span>
<span class="sd">            list of state fips codes to return as a datafrrame.</span>
<span class="sd">        convert : bool</span>
<span class="sd">        if True, return geodataframe, else return dataframe (the default is True).</span>

<span class="sd">        Returns</span>
<span class="sd">        -------</span>
<span class="sd">        type</span>
<span class="sd">        pandas.DataFrame or geopandas.GeoDataFrame</span>
<span class="sd">            2010 blocks as a geodataframe or as a dataframe with geometry</span>
<span class="sd">            stored as well-known binary on the &#39;wkb&#39; column.</span>

<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">try</span><span class="p">:</span>
            <span class="n">blocks_2010</span> <span class="o">=</span> <span class="n">quilt3</span><span class="o">.</span><span class="n">Package</span><span class="o">.</span><span class="n">browse</span><span class="p">(</span><span class="s2">&quot;census/blocks_2010&quot;</span><span class="p">)</span>  <span class="c1"># if any of these aren&#39;t found, stream them instead</span>
        <span class="k">except</span> <span class="ne">FileNotFoundError</span><span class="p">:</span>
            <span class="n">warn</span><span class="p">(</span>
                <span class="s2">&quot;Unable to locate local census 2010 block data. Streaming instead.</span><span class="se">\n</span><span class="s2">&quot;</span>
                <span class="s2">&quot;If you plan to use census data repeatedly you can store it locally &quot;</span>
                <span class="s2">&quot;with the io.store_blocks_2010 function for better performance&quot;</span>
            <span class="p">)</span>
            <span class="k">try</span><span class="p">:</span>
                <span class="n">blocks_2010</span> <span class="o">=</span> <span class="n">quilt3</span><span class="o">.</span><span class="n">Package</span><span class="o">.</span><span class="n">browse</span><span class="p">(</span>
                    <span class="s2">&quot;census/blocks_2010&quot;</span><span class="p">,</span> <span class="s2">&quot;s3://spatial-ucr&quot;</span>
                <span class="p">)</span>

            <span class="k">except</span> <span class="n">Timeout</span><span class="p">:</span>
                <span class="n">warn</span><span class="p">(</span>
                    <span class="s2">&quot;Unable to locate local census data and unable to reach s3 bucket.&quot;</span>
                    <span class="s2">&quot;You will be unable to use built-in data during this session. &quot;</span>
                    <span class="s2">&quot;If you need these data, please try downloading a local copy &quot;</span>
                    <span class="s2">&quot;with the io.store_blocks_2010 function, then restart your &quot;</span>
                    <span class="s2">&quot;python kernel and try again.&quot;</span>
                <span class="p">)</span>

        <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">states</span><span class="p">,</span> <span class="p">(</span><span class="nb">str</span><span class="p">,</span> <span class="nb">int</span><span class="p">)):</span>
            <span class="n">states</span> <span class="o">=</span> <span class="p">[</span><span class="n">states</span><span class="p">]</span>
        <span class="n">blks</span> <span class="o">=</span> <span class="p">{}</span>
        <span class="k">for</span> <span class="n">state</span> <span class="ow">in</span> <span class="n">states</span><span class="p">:</span>
            <span class="n">blks</span><span class="p">[</span><span class="n">state</span><span class="p">]</span> <span class="o">=</span> <span class="n">blocks_2010</span><span class="p">[</span><span class="sa">f</span><span class="s2">&quot;</span><span class="si">{state}</span><span class="s2">.parquet&quot;</span><span class="p">]()</span>
            <span class="k">if</span> <span class="n">fips</span><span class="p">:</span>
                <span class="n">blks</span><span class="p">[</span><span class="n">state</span><span class="p">]</span> <span class="o">=</span> <span class="n">blks</span><span class="p">[</span><span class="n">state</span><span class="p">][</span><span class="n">blks</span><span class="p">[</span><span class="n">state</span><span class="p">][</span><span class="s2">&quot;geoid&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">str</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="n">fips</span><span class="p">)]</span>

            <span class="n">blks</span><span class="p">[</span><span class="n">state</span><span class="p">][</span><span class="s2">&quot;year&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="mi">2010</span>
        <span class="n">blocks</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="n">blks</span><span class="o">.</span><span class="n">values</span><span class="p">())</span>
        <span class="n">blocks</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">concat</span><span class="p">(</span><span class="n">blocks</span><span class="p">,</span> <span class="n">sort</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
        <span class="k">if</span> <span class="n">convert</span><span class="p">:</span>
            <span class="k">return</span> <span class="n">_convert_gdf</span><span class="p">(</span><span class="n">blocks</span><span class="p">)</span>
        <span class="k">return</span> <span class="n">blocks</span>

    <span class="k">def</span> <span class="nf">tracts_1990</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">states</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">convert</span><span class="o">=</span><span class="kc">True</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;Nationwide Census Tracts as drawn in 1990 (cartographic 500k).</span>

<span class="sd">        Parameters</span>
<span class="sd">        ----------</span>
<span class="sd">        states : list-like</span>
<span class="sd">            list of state fips to subset the national dataframe</span>
<span class="sd">        convert : bool</span>
<span class="sd">            if True, return geodataframe, else return dataframe (the default is True).</span>

<span class="sd">        Returns</span>
<span class="sd">        -------</span>
<span class="sd">        pandas.DataFrame or geopandas.GeoDataFrame</span>
<span class="sd">            1990 tracts as a geodataframe or as a dataframe with geometry</span>
<span class="sd">            stored as well-known binary on the &#39;wkb&#39; column.</span>

<span class="sd">        &quot;&quot;&quot;</span>
        <span class="n">t</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">tracts_cartographic</span><span class="p">[</span><span class="s2">&quot;tracts_1990_500k.parquet&quot;</span><span class="p">]()</span>
        <span class="k">if</span> <span class="n">states</span><span class="p">:</span>
            <span class="n">t</span> <span class="o">=</span> <span class="n">t</span><span class="p">[</span><span class="n">t</span><span class="o">.</span><span class="n">geoid</span><span class="o">.</span><span class="n">str</span><span class="p">[:</span><span class="mi">2</span><span class="p">]</span><span class="o">.</span><span class="n">isin</span><span class="p">(</span><span class="n">states</span><span class="p">)]</span>
        <span class="n">t</span><span class="p">[</span><span class="s2">&quot;year&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="mi">1990</span>
        <span class="k">if</span> <span class="n">convert</span><span class="p">:</span>
            <span class="k">return</span> <span class="n">_convert_gdf</span><span class="p">(</span><span class="n">t</span><span class="p">)</span>
        <span class="k">else</span><span class="p">:</span>
            <span class="k">return</span> <span class="n">t</span>

    <span class="k">def</span> <span class="nf">tracts_2000</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">states</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">convert</span><span class="o">=</span><span class="kc">True</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;Nationwide Census Tracts as drawn in 2000 (cartographic 500k).</span>

<span class="sd">        Parameters</span>
<span class="sd">        ----------</span>
<span class="sd">        states : list-like</span>
<span class="sd">            list of state fips to subset the national dataframe</span>
<span class="sd">        convert : bool</span>
<span class="sd">            if True, return geodataframe, else return dataframe (the default is True).</span>

<span class="sd">        Returns</span>
<span class="sd">        -------</span>
<span class="sd">        pandas.DataFrame or geopandas.GeoDataFrame</span>
<span class="sd">            2000 tracts as a geodataframe or as a dataframe with geometry</span>
<span class="sd">            stored as well-known binary on the &#39;wkb&#39; column.</span>

<span class="sd">        &quot;&quot;&quot;</span>
        <span class="n">t</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">tracts_cartographic</span><span class="p">[</span><span class="s2">&quot;tracts_2000_500k.parquet&quot;</span><span class="p">]()</span>
        <span class="k">if</span> <span class="n">states</span><span class="p">:</span>
            <span class="n">t</span> <span class="o">=</span> <span class="n">t</span><span class="p">[</span><span class="n">t</span><span class="o">.</span><span class="n">geoid</span><span class="o">.</span><span class="n">str</span><span class="p">[:</span><span class="mi">2</span><span class="p">]</span><span class="o">.</span><span class="n">isin</span><span class="p">(</span><span class="n">states</span><span class="p">)]</span>
        <span class="n">t</span><span class="p">[</span><span class="s2">&quot;year&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="mi">2000</span>
        <span class="k">if</span> <span class="n">convert</span><span class="p">:</span>
            <span class="k">return</span> <span class="n">_convert_gdf</span><span class="p">(</span><span class="n">t</span><span class="p">)</span>
        <span class="k">else</span><span class="p">:</span>
            <span class="k">return</span> <span class="n">t</span>

    <span class="k">def</span> <span class="nf">tracts_2010</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">states</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">convert</span><span class="o">=</span><span class="kc">True</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;Nationwide Census Tracts as drawn in 2010 (cartographic 500k).</span>

<span class="sd">        Parameters</span>
<span class="sd">        ----------</span>
<span class="sd">        states : list-like</span>
<span class="sd">            list of state fips to subset the national dataframe</span>
<span class="sd">        convert : bool</span>
<span class="sd">            if True, return geodataframe, else return dataframe (the default is True).</span>

<span class="sd">        Returns</span>
<span class="sd">        -------</span>
<span class="sd">        pandas.DataFrame or geopandas.GeoDataFrame</span>
<span class="sd">            2010 tracts as a geodataframe or as a dataframe with geometry</span>
<span class="sd">            stored as well-known binary on the &#39;wkb&#39; column.</span>

<span class="sd">        &quot;&quot;&quot;</span>
        <span class="n">t</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">tracts_cartographic</span><span class="p">[</span><span class="s2">&quot;tracts_2010_500k.parquet&quot;</span><span class="p">]()</span>
        <span class="k">if</span> <span class="n">states</span><span class="p">:</span>
            <span class="n">t</span> <span class="o">=</span> <span class="n">t</span><span class="p">[</span><span class="n">t</span><span class="o">.</span><span class="n">geoid</span><span class="o">.</span><span class="n">str</span><span class="p">[:</span><span class="mi">2</span><span class="p">]</span><span class="o">.</span><span class="n">isin</span><span class="p">(</span><span class="n">states</span><span class="p">)]</span>
        <span class="n">t</span><span class="p">[</span><span class="s2">&quot;year&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="mi">2010</span>
        <span class="k">if</span> <span class="n">convert</span><span class="p">:</span>
            <span class="k">return</span> <span class="n">_convert_gdf</span><span class="p">(</span><span class="n">t</span><span class="p">)</span>
        <span class="k">else</span><span class="p">:</span>
            <span class="k">return</span> <span class="n">t</span>

    <span class="k">def</span> <span class="nf">msas</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">convert</span><span class="o">=</span><span class="kc">True</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;Metropolitan Statistical Areas as drawn in 2010.</span>

<span class="sd">        Data come from the U.S. Census Bureau&#39;s most recent TIGER/LINE files</span>
<span class="sd">        https://www.census.gov/cgi-bin/geo/shapefiles/index.php?year=2018&amp;layergroup=Core+Based+Statistical+Areas</span>

<span class="sd">        Parameters</span>
<span class="sd">        ----------</span>
<span class="sd">        convert : bool</span>
<span class="sd">            if True, return geodataframe, else return dataframe (the default is True).</span>

<span class="sd">        Returns</span>
<span class="sd">        -------</span>
<span class="sd">        pandas.DataFrame or geopandas.GeoDataFrame</span>
<span class="sd">            2010 MSAs as a geodataframe or as a dataframe with geometry</span>
<span class="sd">            stored as well-known binary on the &#39;wkb&#39; column.</span>

<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">if</span> <span class="n">convert</span><span class="p">:</span>
            <span class="k">return</span> <span class="n">_convert_gdf</span><span class="p">(</span>
                <span class="bp">self</span><span class="o">.</span><span class="n">administrative</span><span class="p">[</span><span class="s2">&quot;msas.parquet&quot;</span><span class="p">]()</span><span class="o">.</span><span class="n">sort_values</span><span class="p">(</span><span class="n">by</span><span class="o">=</span><span class="s2">&quot;name&quot;</span><span class="p">)</span>
            <span class="p">)</span>
        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">administrative</span><span class="p">[</span><span class="s2">&quot;msas.parquet&quot;</span><span class="p">]()</span><span class="o">.</span><span class="n">sort_values</span><span class="p">(</span><span class="n">by</span><span class="o">=</span><span class="s2">&quot;name&quot;</span><span class="p">)</span>

    <span class="k">def</span> <span class="nf">states</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">convert</span><span class="o">=</span><span class="kc">True</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;States.</span>

<span class="sd">        Parameters</span>
<span class="sd">        ----------</span>
<span class="sd">        convert : bool</span>
<span class="sd">            if True, return geodataframe, else return dataframe (the default is True).</span>

<span class="sd">        Returns</span>
<span class="sd">        -------</span>
<span class="sd">        pandas.DataFrame or geopandas.GeoDataFrame</span>
<span class="sd">            US States as a geodataframe or as a dataframe with geometry</span>
<span class="sd">            stored as well-known binary on the &#39;wkb&#39; column.</span>

<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">if</span> <span class="n">convert</span><span class="p">:</span>
            <span class="k">return</span> <span class="n">_convert_gdf</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">administrative</span><span class="p">[</span><span class="s2">&quot;states.parquet&quot;</span><span class="p">]())</span>
        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">administrative</span><span class="p">[</span><span class="s2">&quot;states.parquet&quot;</span><span class="p">]()</span>

    <span class="k">def</span> <span class="nf">counties</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;Nationwide counties as drawn in 2010.</span>

<span class="sd">        Parameters</span>
<span class="sd">        ----------</span>
<span class="sd">        convert : bool</span>
<span class="sd">            if True, return geodataframe, else return dataframe (the default is True).</span>

<span class="sd">        Returns</span>
<span class="sd">        -------</span>
<span class="sd">        geopandas.GeoDataFrame</span>
<span class="sd">            2010 counties as a geodataframe or as a dataframe with geometry</span>
<span class="sd">            stored as well-known binary on the &#39;wkb&#39; column.</span>

<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">return</span> <span class="n">_convert_gdf</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">administrative</span><span class="p">[</span><span class="s2">&quot;counties.parquet&quot;</span><span class="p">]())</span>

    <span class="k">def</span> <span class="nf">msa_definitions</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;2010 Metropolitan Statistical Area definitions.</span>

<span class="sd">        Data come from the U.S. Census Bureau&#39;s most recent delineation files, available at</span>
<span class="sd">        https://www.census.gov/geographies/reference-files/time-series/demo/metro-micro/delineation-files.html</span>

<span class="sd">        Returns</span>
<span class="sd">        -------</span>
<span class="sd">        pandas.DataFrame.</span>
<span class="sd">            dataframe that stores state/county --&gt; MSA crosswalk definitions.</span>

<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">administrative</span><span class="p">[</span><span class="s2">&quot;msa_definitions.parquet&quot;</span><span class="p">]()</span>

    <span class="k">def</span> <span class="nf">ltdb</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;Longitudinal Tract Database (LTDB).</span>

<span class="sd">        Returns</span>
<span class="sd">        -------</span>
<span class="sd">        pandas.DataFrame or geopandas.GeoDataFrame</span>
<span class="sd">            LTDB as a long-form geo/dataframe</span>

<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">try</span><span class="p">:</span>
            <span class="k">return</span> <span class="n">storage</span><span class="p">[</span><span class="s2">&quot;ltdb&quot;</span><span class="p">]()</span>
        <span class="k">except</span> <span class="ne">KeyError</span><span class="p">:</span>
            <span class="nb">print</span><span class="p">(</span>
                <span class="s2">&quot;Unable to locate LTDB data. Try saving the data again &quot;</span>
                <span class="s2">&quot;using the `store_ltdb` function&quot;</span>
            <span class="p">)</span>

    <span class="k">def</span> <span class="nf">ncdb</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;Geolytics Neighborhood Change Database (NCDB).</span>

<span class="sd">        Returns</span>
<span class="sd">        -------</span>
<span class="sd">        pandas.DataFrarme</span>
<span class="sd">            NCDB as a long-form dataframe</span>

<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">try</span><span class="p">:</span>
            <span class="k">return</span> <span class="n">storage</span><span class="p">[</span><span class="s2">&quot;ncdb&quot;</span><span class="p">]()</span>
        <span class="k">except</span> <span class="ne">KeyError</span><span class="p">:</span>
            <span class="nb">print</span><span class="p">(</span>
                <span class="s2">&quot;Unable to locate NCDB data. Try saving the data again &quot;</span>
                <span class="s2">&quot;using the `store_ncdb` function&quot;</span>
            <span class="p">)</span>

    <span class="k">def</span> <span class="nf">codebook</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;Codebook.</span>

<span class="sd">        Returns</span>
<span class="sd">        -------</span>
<span class="sd">        pandas.DataFrame</span>
<span class="sd">            codebook that stores variable names, definitions, and formulas.</span>

<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">return</span> <span class="n">pd</span><span class="o">.</span><span class="n">read_csv</span><span class="p">(</span>
            <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">dirname</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">abspath</span><span class="p">(</span><span class="vm">__file__</span><span class="p">)),</span> <span class="s2">&quot;io/variables.csv&quot;</span><span class="p">)</span>
        <span class="p">)</span>


<span class="n">datasets</span> <span class="o">=</span> <span class="n">DataStore</span><span class="p">()</span>
</pre></div>

    </div>
      
  </div>
</div>
<footer class="footer">
  <div class="container">
    <p class="pull-right">
      <a href="#">Back to top</a>
      
        <br/>
        
      
    </p>
    <p>
        &copy; Copyright 2020, geosnap developers.<br/>
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 2.4.4.<br/>
    </p>
  </div>
</footer>
  </body>
</html>